#include <QtGui/QApplication>
#include <QtGui/QMainWindow>
#include <QtDeclarative>
#include "appdata.h"

#if defined(Q_OS_SYMBIAN)
#include <eikenv.h>
#include <eikappui.h>
#include <aknenv.h>
#include <aknappui.h>
#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK

int main(int argc, char *argv[])
{
    qApp->setApplicationName("Hit the Monkey 2.0");
    QApplication app(argc, argv);

    QDeclarativeView view;
    AppData appData;
    view.rootContext()->setContextProperty("appData", &appData);
    view.setSource(QUrl("qrc:/resources/main.qml"));

    #ifdef Q_OS_SYMBIAN
        const CAknAppUiBase::TAppUiOrientation uiOrientation = CAknAppUi::EAppUiOrientationPortrait;

        CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
        TRAPD(error,
            if (appUi)
                appUi->SetOrientationL(uiOrientation);
        );
        Q_UNUSED(error)
    #endif

    view.showFullScreen();

    return app.exec();
}
